/*
 * @Author: alan_mf
 * @Date: 2024-05-11 15:58:27
 * @LastEditors: alan_mf
 * @LastEditTime: 2024-05-15 16:22:51
 * @FilePath: /nuanyunOA_new/src/api/health.ts
 * @Description:
 *
 */
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
export type BannerResult = {
  page: number;
  pagesize: number;
  success: boolean;
  code: number;
  token: string;
  msg: string;
  data: {
    img(img: any): string;
    data: any[];
    total: number;
    page: number;
    pagesize: number;
  };
};

/**问卷列表 */
export const healthList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("checkup/list"), {
    data
  });
};

/**更新问卷 */
export const healthUpdate = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("checkup/update"), {
    data
  });
};

/**删除问卷 */
export const healthDelete = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("checkup/delete"), {
    data
  });
};

/**问卷详情 */
export const healthDetail = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("checkup/info"), {
    data
  });
};

/**问卷记录 */
export const healthRecord = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("checkup/userList"), {
    data
  });
};
